var str = prompt("请输入一组座机号码");
var reg = /^0\d{2,3}-\d{8}$/;
console.log(reg.test(str));